<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>

<!DOCTYPE html>
<html>
	<head>
		<title>学员预约管理</title>
		<meta name="decorator" content="default"/>
		<script type="text/javascript">     
			$(function(){ 
				var defHeight = 300,wh=$(window).height();
				var lh=$('.location').height(),fh=$('#floatHead').height(),sh=$('.det-list').height(),ph=$('.pagelist').height();
				defHeight = (wh-lh-fh-sh-ph-130);
				$('.flexgrid').flexigrid({striped:true,height:defHeight});
			});
			
			function page(n,s){
				$("#pageNo").val(n);
				$("#pageSize").val(s);
				$("#searchForm").submit();
	        	return false;
	        }
	        
	        function deleteAll(){
				var ids =[];//定义一个数组    
	            $('input[name="checkall"]:checked').each(function(){    
	                ids.push($.trim($(this).val()));
	            });
	            document.location.href='${ctx}/qd/courseOrder//delete?ids='+ids;
			}
		</script>
	</head>
	<body>
		<sys:message content="${message}"/>
		<!--导航栏-->
		<div class="location">
			<a href="javascript:history.back(-1);" class="back"><i></i><span>返回上一页</span></a>
			<a href="${ctx}/center" class="home"><i></i>
			<span>首页</span></a> 
			<i class="arrow"></i> 
			<span>学员预约管理</span>
		</div>
		<!--/导航栏-->

		<!--工具栏-->
		<div id="floatHead" class="toolbar-wrap">
			<div class="toolbar">
				<div class="box-wrap">
					<a class="menu-btn"></a>
					<div class="l-list">
						<ul class="icon-list">
						</ul>
					</div>
					<div class="r-list" style="display:none;">
						<input name="txtKeywords" type="text" id="txtKeywords" class="keyword" /> 
						<a id="lbtnSearch" class="btn-search" href="javascript:void(0)">查询</a>
					</div>
				</div>
			</div>
		</div>
		<!--/工具栏-->
		
		<!--搜索栏-->
		<form:form id="searchForm" modelAttribute="courseOrder" action="${ctx}/qd/courseorder" method="post">
			<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
			<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
			<div class="det-list clearfix">
			    <div class="group btm">
					<div class="control">
			            <div class="title">订单编号</div>
			            <form:input path="orderno" htmlEscape="false" cssClass="input normal"/>
			        </div>
					<div class="control">
			            <div class="title">学员姓名</div>
			            <form:input path="student.name" htmlEscape="false" cssClass="input normal"/>
			        </div>
			        <div class="control">
			            <div class="title">会员姓名</div>
			            <form:input path="member.name" htmlEscape="false" cssClass="input normal"/>
			        </div>
			        <div class="control">
			            <div class="title">会员手机号</div>
			            <form:input path="member.mobile" htmlEscape="false" cssClass="input normal"/>
			        </div>
			    </div>  
			    <br>
			     <div class="group btm">
			     <div class="control">
			            <div class="title">学阶</div>
			            <div class="rule-single-select single-select">
										<form:select path="course.clevel" >
											<form:option value="" selected="selected" label="请选择" />
											<form:option value="L1"  label="L1" />
											<form:option value="L2"  label="L2" />
											<form:option value="L3"  label="L3" />
											<form:option value="L4"  label="L4" />
											<form:option value="L5"  label="L5" />
											<form:option value="L6"  label="L6" />
										</form:select>
							</div>
			        </div>
			        <div class="control">
			            <div class="title">系列</div>
			            <div class="rule-single-select single-select">
										<form:select path="course.serial" >
											<form:option value="" selected="selected" label="请选择" />
											<form:option value="NK"  label="NK" />
											<form:option value="CC"  label="CC" />
											<form:option value="户外"  label="户外" />
										</form:select>
							</div>
			        </div>
			        <div class="control">
			            <div class="title">状态</div>
			            <div class="rule-single-select single-select">
										<form:select path="state" >
											<form:option value="" selected="selected" label="请选择" />
											<form:option value="signed"  label="已签到" />
											<form:option value="ordered"  label="已预约" />
											<form:option value="queuing"  label="等位中" />
											<form:option value="leaved"  label="已请假" />
											<form:option value="absented"  label="已旷课" />
											<form:option value="aborted"  label="已中止" />
										</form:select>
							</div>
			        </div>
			        <div class="control">
			            <div class="title">主题</div>
			            <form:input path="course.theme" htmlEscape="false" cssClass="input normal"/>
			        </div>
			     </div> 
			    <br>
			     <div class="group btm">
			     <div class="control">
			            <div class="title">已扣费</div>
			            <div class="rule-single-select single-select">
										<form:select path="paid" >
											<form:option value="" selected="selected" label="请选择" />
											<form:option value="0"  label="否" />
											<form:option value="1"  label="是" />
										</form:select>
							</div>
			        </div>
			        <div class="control">
			            <div class="title">免费体验</div>
			            <div class="rule-single-select single-select">
										<form:select path="contract.isFree" >
											<form:option value="" selected="selected" label="请选择" />
											<form:option value="0"  label="否" />
											<form:option value="1"  label="是" />
										</form:select>
							</div>
			        </div>
				     <div class="control">
				            <div class="title">上课日期</div>
				            <div class="date-input">
				            	<i></i>
				            	<fmt:formatDate value="${courseOrder.startOn}" pattern="yyyy-MM-dd" var="startOn" />
				            	<form:input path="startOn"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});" htmlEscape="false" cssClass="input" value="${startOn}" />&nbsp;&nbsp;&nbsp;~
				            </div>
				        </div>
				         <div class="date-input">
				            <i></i>
				            <fmt:formatDate value="${courseOrder.endOn}" pattern="yyyy-MM-dd" var="endOn" />
				          	 <form:input path="endOn"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});"  htmlEscape="false" cssClass="input" value="${endOn}" />
			          	 </div>
			     </div>
			    <div class="group searchbtn">
			        <div class="btn-list">
			            <input type="submit" name="btnDetailedSearch" value="查询" id="btnDetailedSearch" class="btn">
			            <input name="btnReturn" type="reset" value="重置" class="btn yellow">
			        </div>
			    </div>
			    <div style="clear:both;"></div>
			</div>
		</form:form>
		<!--/搜索栏-->
		
		<!--列表-->
		<div class="table-container">
			<table class="flexgrid">
				<thead>
					<tr>			
						<th width="25">选择</th>			
						<th width="100">订单编号</th>	
						<th width="80">上课日期</th>		
						<th width="80">上课时间</th>					
						<th width="50">学阶</th>
						<th width="50">系列</th>
						<th width="50">主题</th>
						<th width="100">学员姓名</th>
						<th width="100">会员姓名</th>
						<th width="100">会员手机号</th>
						<th width="100">是否已扣费</th>
						<th width="100">状态</th>
						<th width="100">合同编号</th>
						<th width="100">合同金额</th>
						<th width="100">是否免费体验</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${page.list}" var="courseOrder">
					<tr>									
						<td style="text-align:center;">
							<span class="checkall" style="vertical-align: middle;">
								<input type="checkbox" name="checkall" value="${courseOrder.id}" />
							</span> 
							<%-- <input type="hidden" name="checkall" value="${courseOrder.id}" /> --%>
						</td>					
						<td>${courseOrder.orderno}</td>
						<td><fmt:formatDate value="${courseOrder.course.ondate}" pattern="yyyy-MM-dd"  /></td>
						<td>${courseOrder.course.section}</td>
						<td>${courseOrder.course.clevel}</td>
						<td>${courseOrder.course.serial}</td>			
						<td>${courseOrder.course.theme}</td>
						<td>${courseOrder.student.name}</td>
						<td>${courseOrder.student.member.name}</td>
						<td>${courseOrder.student.contract.member.mobile}</td>
						<c:choose> 
						            <c:when test="${courseOrder.paid  == '0' }"><td>否</td></c:when>
						            <c:when test="${courseOrder.paid == '1' }"><td>是</td></c:when>  			            
						            <c:otherwise><td>尚未定义</td></c:otherwise> 
						</c:choose>							
						<c:choose> 
						            <c:when test="${courseOrder.state  == 'signed' }"><td>已签到</td></c:when>
						            <c:when test="${courseOrder.state  == 'canceled' }"><td>已取消</td></c:when>  
						            <c:when test="${courseOrder.state  == 'ordered' }"><td>已预约</td></c:when>  
						            <c:when test="${courseOrder.state  == 'queuing' }"><td>等位中</td></c:when>  
						            <c:when test="${courseOrder.state  == 'leaved' }"><td>已请假</td></c:when>  
						            <c:when test="${courseOrder.state  == 'absented' }"><td>已旷课</td></c:when>  
						            <c:when test="${courseOrder.state  == 'aborted' }"><td>已中止</td></c:when>  					            
						            <c:otherwise><td>尚未定义</td></c:otherwise> 
						</c:choose>
						<td>${courseOrder.contract.code}</td>
						<td>${courseOrder.contract.amount}</td>
						<td> <c:choose><c:when test="${courseOrder.contract.isFree == 1}">是</c:when><c:when test="${courseOrder.contract.isFree == 0}">否</c:when></c:choose></td>									
					</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
		<!--/列表-->

		<!--内容底部-->
		<div class="line10"></div>
		<div class="pagelist">
			${page}
		</div>
		<!--/内容底部-->
	</body>
</html>
